<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组</title>
</head>
<body>

    <ul id="ul">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
    </ul>

    <script>
        let arr = ['1aa',2,3,5];
        // .map
        let list = arr.map(item => {
            return item + '--';
        })
        console.log(list);
        // .filter
        let list_1 = arr.filter((n) => n >= 2)
        console.log(list_1);
        // .forEach
        arr.forEach((item, index, t) => {
            console.log(item, index, t === arr)
        })

        let liList = document.getElementsByTagName('li');
        console.log(
            liList
        )
        Array.from(liList).forEach((item) => {
            console.log(item)
        })

    </script>
</body>
</html>